﻿using DropBoxClient.Entities;
using DropBoxClient.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DropBoxClient.Operations
{
    internal class GetAccountInfoOperation
    {
        private static readonly string Url = "https://api.dropbox.com/1/account/info";
        private static readonly string MethodType = StringConstants.GetMethodType;

        private WebOperation<AccountInfo> _operation;
        private string _accessToken;

        internal GetAccountInfoOperation(string accessToken)
        {
            _accessToken = accessToken;
        }

        internal AccountInfo Execute()
        {
            _operation = new WebOperation<AccountInfo>(Url, _accessToken, MethodType);
            return _operation.Execute();
        }
    }
}
